import java.util.ArrayList;
import java.util.List;

//通过 subList 得到“子列表”
public class Demo9 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.add("ddd");
        list.add("ccc");
        System.out.println(list);

        System.out.println(list.subList(1,4));//前开后闭

        List<String> sub = new ArrayList<>(list.subList(1,4));

        //删除
        list.clear();
        System.out.println(list);
    }
}
